package com.vue.controller.student;

import com.vue.dto.CoursePageQueryDTO;
import com.vue.result.PageResult;
import com.vue.result.Result;
import com.vue.service.CourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("studentCourseController")
@RequestMapping("/student/course")
@Api(tags = "课程相关接口")
@Slf4j
public class CourseController {
    @Autowired
    private CourseService courseService;

    /**
     * 课程分页查询
     * @param coursePageQueryDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("课程分页查询")
    public Result<PageResult> coursePage(CoursePageQueryDTO coursePageQueryDTO) {
        log.info("课程分页查询：{}", coursePageQueryDTO);
        PageResult pageResult = courseService.PageQuery(coursePageQueryDTO);
        return Result.success(pageResult);
    }
}
